package com.yloveg.impl;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yloveg.dao.SRoleMapper;
import com.yloveg.entity.SRole;
import com.yloveg.service.SRoleService;

@Service
public class SRoleServiceImpl implements SRoleService {
 
    @Autowired
    private SRoleMapper sRoleMapper;

	@Override
	public PageInfo<SRole> queryUserMsgPage(int page, int limit, SRole sRole) {
		// TODO Auto-generated method stub
		PageHelper.startPage(page, limit);
		List<SRole> sRoleList = sRoleMapper.querySRole(sRole);
		PageInfo<SRole> resultPage=new PageInfo<SRole>(sRoleList);
		return resultPage;
	}

	@Override
	public int insertSRole(SRole sRole) {
		// TODO Auto-generated method stub
		sRole.setCreateDate(new Date());
		sRole.setState(1);
		return sRoleMapper.insert(sRole);
	}

	@Override
	public int updateByPrimaryKeySelective(SRole sRole) {
		// TODO Auto-generated method stub
		sRole.setUpdateDate(new Date());
		return sRoleMapper.updateByPrimaryKeySelective(sRole);
	}

	@Override
	public SRole selectByPrimaryKey(Long id) {
		// TODO Auto-generated method stub
		return sRoleMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<Map<String,Object>> queryUserMsgMap(SRole sRole) {
		return sRoleMapper.queryUserMsgMap(sRole);
	}




 
 


}
